Dock [v2.0 b3]

作者: majkinetor 最近更新时间: nonexistent


Dock desired top level windows (dock clients) to any top level window (dock host).

Using dock module you can glue your or third-party windows to any top level window. Docked windows in module terminology are called Clients and the window that keeps their position relative to itself is called Host. Once Clients are connected to the Host, this group of windows will behave like single window - moving, sizing, focusing, hiding and other OS events will be handled by the module so that the 揷omposite window� behaves like the single window.

Dock(pClientID, pDockDef="", reset=0)
Dock_HookProc(hWinEventHook, event, hwnd, idObject, idChild, dwEventThread, dwmsEventTime )
Dock_Shutdown()
Dock_Toggle(false)
Dock_Update()

关于函数的参数和返回值, 请参阅其源码或 此文档.

备注

Its not strictly stdlib conform, because it works with global variables AND have subroutines with Return statements. If you want to use this library, you must include at the end of your script after last Return (end of AutoExec).

See at DockA for regular AutoHotkey Guis:
* GUID=ed633b80-ac75-126a-97c9-1634b021e32f

关于此函数(集)的更新细节和注意事项, 请参见 AutoHotkey 论坛: http://www.autohotkey.com/forum/viewtopic.php?t=19400

许可

此函数(集)是基于 CC By-Nc 3.0 许可的开源项目. 想了解许可详情, 请参见 http://creativecommons.org/licenses/by-nc/3.0/

示例

; #Include Dock.ahk
SetBatchLines, -1 
#SingleInstance, force 
   
   Msgbox This test will monitor Notepad appearance and add customizable number of dock clients to its left side.

   host := "ahk_class Notepad" 
   clientNo := 5 


   loop, %clientNo% 
   { 
      Gui %A_Index%:+LastFound +ToolWindow +Border +Resize -Caption 
      Gui,%A_Index%:Add, Button, 0x8000, %A_Index% 
      c%A_Index% := WinExist() 

      Dock("+" c%A_Index%, "0,-1,-10, 0,0," A_Index*50 ",0,50,0,50") 
   } 

   Dock_OnHostDeath := "OnHostDeath" 

return 

FindHost: 
   if Dock_HostID := WinExist(host) 
   { 
      SetTimer, FindHost, OFF 
       loop, %clientNo% 
         DllCall("ShowWindow", "uint", c%A_Index%, "uint", 5)     
       
      Dock_Toggle(true) 
   } 
return 

OnHostDeath: 
   SetTimer, FindHost, 100 
return